# Contributor: Duncan Bellamy <dunk@denkimushi.com>
# Maintainer: Duncan Bellamy <dunk@denkimushi.com>
pkgname=isa-l_crypto
pkgver=2.24.0
pkgrel=1
pkgdesc="Intelligent Storage Acceleration Library with crypto"
url="https://github.com/intel/isa-l_crypto"
# other arches fail tests, x86 fails to compile
arch="aarch64 x86_64"
license="BSD-3-Clause"
source="$pkgname-$pkgver.tar.gz::https://github.com/intel/isa-l_crypto/archive/refs/tags/v$pkgver.tar.gz
	$pkgname-static.patch::https://github.com/intel/isa-l_crypto/commit/4f729766da9021e3074191bab07820a8ed6cad6b.patch
	"
subpackages="$pkgname-dev"
makedepends="autoconf automake libtool openssl-dev linux-headers nasm"

case "$CARCH" in
x86_64)
	# todo
	options="$options !check"
	;;
esac

prepare() {
	default_prepare
	autoreconf -vif
}

build() {
	./configure --build=$CBUILD --host=$CHOST --disable-static
	make
}

check() {
	make -j1 test
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="
f72800a8ff9c0b2bfdd88cb6780db91bfd5763af04a6318aa3acaff0b1326e3348cb3a4aff17c99636eb291d1ff6249dcf896392a2450adacd83ddbf4c7299da  isa-l_crypto-2.24.0.tar.gz
f8fa512fe1768f34c87292f558c91025647f0ed3820fe6d0e6360b68eb09e820c2ec269155718fdd09bc1698ce2ae4c1e9c8fa202a07cb4ad371422131efd691  isa-l_crypto-static.patch
"
